package com.ama.service.impl;

import com.ama.dao.BedDao;
import com.ama.pojo.Bed;
import com.ama.service.BedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BedServiceImpl implements BedService {
    @Autowired
    private BedDao bedDao;

    @Override
    public int deleteById(Long bedId) {
        return bedDao.deleteById(bedId);
    }

    @Override
    public int insertBed(Bed bed) {
        return bedDao.insertBed(bed);
    }

    @Override
    public int insertSelective(Bed bed) {
        return bedDao.insertSelective(bed);
    }

    @Override
    public Bed selectById(Long bedId) {
        return bedDao.selectById(bedId);
    }

    @Override
    public List<Bed> selectByRoomId(Long roomId) {
        return bedDao.selectByRoomId(roomId);
    }

    @Override
    public int updateByIdSelective(Bed bed) {
        return bedDao.updateByPrimaryKeySelective(bed);
    }

    @Override
    public int updateById(Bed bed) {
        return bedDao.updateById(bed);
    }
}
